<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><%= @page_title ||= "BEMA" %></title>
    <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>
    <%= favicon_link_tag '/favicon.png', type: 'image/png' %>
    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    <%= csrf_meta_tags %>
  </head>
  <body>
    <% if current_user then %>
      <%= render "layouts/top_menu" %>
    <% end %>
    <div class="container-fluid">
      <div class="row">
        <% if content_for?(:sidebar) %>
          <div id="sidebar" class="col-md-2">
            <%= yield :sidebar %>
          </div>
          <div class="col-md-10">
        <% else %>
          <div class="col-md-12">
        <% end %>
          <% flash.each do |name,msg| %>
            <%= content_tag :div, msg, id: "flash_#{name}" %>
          <% end %>
          <p id="js-notice"></p>
          <%= content_tag :p, flash[notice], class: "notice" if flash[notice] %>
          <%= content_tag :p, flash[alert], class: "alert" if flash[alert] %>
          <%= yield %><br/><br/>
          <div class="col-md-12">
            <%= render "layouts/footer" %>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
